[id].vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <template>
  2. <!-- 页面头部 -->
  3. <HomePageHead></HomePageHead>
  4. <!-- 导航栏 -->
  5. <HomePageNavigation1></HomePageNavigation1>
  6. <!-- 列表页广告一 -->
  7. <HomeTopTen :imgurl="adImg1" v-if="adImg1"></HomeTopTen>
  8. <!-- 面包屑导航 -->
  9. <div class="breadcrumb">
  10. <div class="inner">
  11. <span class="location">当前位置:</span>
  12. <el-breadcrumb :separator-icon="ArrowRight">
  13. <el-breadcrumb-item>
  14. <NuxtLink to="/">首页</NuxtLink>
  15. </el-breadcrumb-item>
  16. <el-breadcrumb-item v-show="name">
  17. <NuxtLink :to="{ path: `/primaryNavigation/${listid}`}">{{name}}</NuxtLink>
  18. </el-breadcrumb-item>
  19. <el-breadcrumb-item>
  20. {{ newsDetail.con_title }}
  21. </el-breadcrumb-item>
  22. </el-breadcrumb>
  23. </div>
  24. </div>
  25. <!-- 资讯列表 -->
  26. <div class="newsDetail">
  27. <div class="inner">
  28. <div class="innerLeft">
  29. <div class="leftBottomTitle">{{ newsDetail.con_title }}</div>
  30. <div class="leftBottom" v-html="newsDetail.content" v-if="newsDetail.content"></div>
  31. </div>
  32. <div class="innerRight">
  33. <div class="rightMenuTitle">导航列表</div>
  34. <ul>
  35. <li v-for="(item, index) in bottomMenu" :key="index">
  36. <NuxtLink :to="`/speciaArticle/${item.id}`" :title="item.name"
  37. v-if="item.id == pageId && item.id != 7" class="active">
  38. {{ item.name }}
  39. </NuxtLink>
  40. <NuxtLink :to="`/speciaArticle/${item.id}`" :title="item.name"
  41. v-else-if="item.id != pageId && item.id != 7">
  42. {{ item.name }}
  43. </NuxtLink>
  44. <NuxtLink :to="`/specialList/${item.id}`" :title="item.name"
  45. v-if="item.id == 7 && pageId == 7 && routeHref == '/specialList/7'" class="active">
  46. {{item.name }}
  47. </NuxtLink>
  48. <NuxtLink :to="`/specialList/${item.id}`" :title="item.name" v-else-if="item.id == 7">
  49. {{ item.name}}
  50. </NuxtLink>
  51. </li>
  52. </ul>
  53. </div>
  54. <div style="clear: both;"></div>
  55. </div>
  56. </div>
  57. <!-- 广告二 -->
  58. <HomeTopTen :imgurl="adImg2" v-if="adImg2"></HomeTopTen>
  59. <!-- 页面底部 -->
  60. <HomeFoot1></HomeFoot1>
  61. </template>
  62. <script setup>
  63. //1.页面依赖 start ---------------------------------------->
  64. import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
  65. import { ArrowRight } from '@element-plus/icons-vue'
  66. import { ref, onMounted } from 'vue';
  67. //获得跳转过来的id
  68. const route = useRoute();
  69. const articleId = route.params.id; //获得该页面的id
  70. const listid = route.query.listId; //获得该页面的id
  71. const name = route.query.listName; //获得该页面的id
  72. const pageId = route.params.id; //获得该页面的id
  73. const routeHref = route.href;
  74. //1.页面依赖 end ---------------------------------------->
  75. //2.页面数据 start ---------------------------------------->
  76. //广告列表
  77. let adImg1 = ref([]);
  78. let adImg2 = ref([]);
  79. async function getAdData(){
  80. const adData = await requestDataPromise('/web/getWebsiteAdvertisement',{method:'GET',query:{'ad_tag':'PAGE'}});
  81. adList.value = adData.data;
  82. if(adData.code==200){
  83. for(let item of adData.data){
  84. if(item.ad_tag == 'PAGE_0001'){
  85. adImg1.value = item;
  86. }
  87. if(item.ad_tag == 'PAGE_0002'){
  88. adImg2.value = item;
  89. }
  90. }
  91. }else{
  92. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  93. console.log("错误位置:获取详情页广告列表")
  94. console.log("后端错误反馈:",adData.message)
  95. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  96. }
  97. }
  98. getAdData();
  99. const newsDetail = ref({})
  100. const bottomMenu = ref([]);
  101. async function getPageData() {
  102. const mkdata = await requestDataPromise('/web/getWebsiteFooterCategoryInfo', {
  103. method: 'GET',
  104. query: {
  105. 'fcat_id': articleId
  106. },
  107. });
  108. newsDetail.value = mkdata.data;
  109. }
  110. getPageData();
  111. async function getPageMenu() {
  112. const mkdata = await requestDataPromise('/web/getWebsiteFooterCategory', {
  113. method: 'GET',
  114. query: {},
  115. });
  116. bottomMenu.value = mkdata.data;
  117. }
  118. getPageMenu();
  119. //2.页面数据 end ---------------------------------------->
  120. //4.设置seo信息 start---------------------------------------->
  121. //4.1 设置seo信息
  122. const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
  123. method: 'GET',
  124. query: {},
  125. });
  126. let seoTitle = setData.data.website_head.title;
  127. let seoDescription = setData.data.website_head.description;
  128. let seoKeywords = setData.data.website_head.keywords;
  129. let seoSuffix = setData.data.website_head.suffix;
  130. let seoName = setData.data.website_head.website_name;
  131. useSeoMeta({
  132. title: seoTitle + "_" + seoSuffix,
  133. meta: [
  134. { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  135. { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix , tagPriority: 10 }
  136. ]
  137. });
  138. //4.设置seo信息 end---------------------------------------->
  139. onMounted(async () => {
  140. //从客户端获取行政职能部门 加快打开速度
  141. const { $webUrl, $CwebUrl } = useNuxtApp();
  142. //广告1
  143. let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_page_0001`
  144. const responseAd1 = await fetch(url, {
  145. headers: {
  146. 'Content-Type': 'application/json',
  147. 'Userurl': $CwebUrl,
  148. 'Origin': $CwebUrl
  149. }
  150. });
  151. const resultAd1 = await responseAd1.json();
  152. adImg1.value = resultAd1.data[0];
  153. //广告2
  154. let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_page_0002`
  155. const responseAd2 = await fetch(url2, {
  156. headers: {
  157. 'Content-Type': 'application/json',
  158. 'Userurl': $CwebUrl,
  159. 'Origin': $CwebUrl
  160. }
  161. });
  162. const resultAd2 = await responseAd2.json();
  163. adImg2.value = resultAd2.data[0];
  164. })
  165. </script>
  166. <style lang="less" scoped>
  167. //导航条
  168. .breadcrumb {
  169. width: 100%;
  170. height: 22px;
  171. margin-bottom: 30px;
  172. font-family: Microsoft YaHei, Microsoft YaHei;
  173. font-weight: 400;
  174. font-size: 20px;
  175. color: #666666;
  176. line-height: 23px;
  177. text-align: left;
  178. font-style: normal;
  179. text-transform: none;
  180. .el-breadcrumb::v-deep {
  181. display: inline-block;
  182. vertical-align: -4px;
  183. }
  184. /deep/.el-breadcrumb__inner a,
  185. /deep/.el-breadcrumb__inner.is-link {
  186. color: #666666;
  187. font-weight: 400;
  188. text-decoration: none;
  189. transition: var(--el-transition-color);
  190. }
  191. span {
  192. font-family: Microsoft YaHei, Microsoft YaHei;
  193. font-weight: 400;
  194. font-size: 20px;
  195. color: #666666;
  196. line-height: 23px;
  197. text-align: left;
  198. font-style: normal;
  199. text-transform: none;
  200. }
  201. span:hover {
  202. color: #666666;
  203. }
  204. .location {
  205. margin-right: 20px;
  206. width: 100px;
  207. height: 22px;
  208. font-family: Microsoft YaHei, Microsoft YaHei;
  209. font-weight: 400;
  210. font-size: 20px;
  211. color: #666666;
  212. line-height: 23px;
  213. text-align: left;
  214. font-style: normal;
  215. text-transform: none;
  216. }
  217. }
  218. // 资讯列表
  219. .newsDetail {
  220. width: 100%;
  221. //height: 1400px;
  222. margin-bottom: 70px;
  223. .inner {
  224. width: 1200px;
  225. //height: 1400px;
  226. font-size: 16px;
  227. .innerLeft {
  228. //height: 1400px;
  229. float: right;
  230. .LeftTop {
  231. //height: 522px;
  232. margin-top: 50px;
  233. >h1 {
  234. line-height: 40px;
  235. margin-bottom: 30px;
  236. font-family: Microsoft YaHei, Microsoft YaHei;
  237. font-weight: bold;
  238. font-size: 30px;
  239. color: #333333;
  240. }
  241. >p {
  242. height: 18px;
  243. line-height: 18px;
  244. font-family: Microsoft YaHei, Microsoft YaHei;
  245. font-weight: 400;
  246. font-size: 14px;
  247. color: #999999;
  248. span {
  249. margin-right: 40px;
  250. }
  251. }
  252. >img {
  253. width: 680px;
  254. height: 382px;
  255. padding: 50px 0px 60px 55px;
  256. }
  257. }
  258. .leftBottomTitle {
  259. color: #028E21;
  260. font-size: 24px;
  261. font-weight: bold;
  262. height: 60px;
  263. line-height: 60px;
  264. }
  265. .leftBottom {
  266. width: 790px;
  267. font-size: 20px;
  268. border-top: 1px solid #139602;
  269. padding-top: 40px;
  270. >h3,
  271. >p {
  272. text-indent: 2em;
  273. width: 790px;
  274. font-family: Microsoft YaHei, Microsoft YaHei;
  275. font-size: 20px;
  276. color: #333333;
  277. line-height: 23px;
  278. padding-bottom: 30px;
  279. }
  280. >h3 {
  281. font-weight: 600px;
  282. }
  283. >p {
  284. font-weight: 400;
  285. }
  286. }
  287. }
  288. .innerRight {
  289. width: 279px;
  290. .rightMenuTitle {
  291. width: 279px;
  292. height: 69px;
  293. font-size: 22px;
  294. font-weight: bold;
  295. line-height: 58px;
  296. text-align: center;
  297. color: #fff;
  298. background: url("http://img.bjzxtw.org.cn/master/bjzxtw/public/special/projectMoreTitle.png") no-repeat;
  299. margin-bottom: 30px;
  300. }
  301. ul {
  302. li {
  303. a {
  304. border-left: 5px solid #028E21;
  305. margin-bottom: 15px;
  306. font-size: 22px;
  307. display: block;
  308. height: 61px;
  309. line-height: 61px;
  310. color: #333333;
  311. text-align: center;
  312. background: #FBFBFB;
  313. }
  314. }
  315. }
  316. .active {
  317. border-left: 0;
  318. border: 1px solid #028E21;
  319. background: #fff;
  320. }
  321. }
  322. }
  323. }
  324. </style>